<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        $this->success('正在跳转...', '/Admin');
        exit;
    }

    public function showartdet(){
        $data = filterInput($_GET);
        $id = $data['id'];
        $art_model = D('Typearticle');
        $one = $art_model->queryObj($id, 'id');
        $one['click'] = $one['click']+1;
        $art_model->save($one);
        $this->assign('obj', $one);
        $this->display('artdetail');

    }

    public function showartlist(){
        $data = filterInput($_GET);
        $type = $data['type'];
        $map['type'] = array('eq', $type);
        $compant = get_article_page_list($map);
        $this->assign('list', $compant['list']);
        $this->assign('page', $compant['show']);
        $this->display('artlist');
    }

    public function showsingle(){
        $data = filterInput($_GET);
        $type = $data['type'];
        $map['parentid'] = array('eq', $type);
        $single_model = D('Singlepage');
        $one = $single_model->where($map)->find();
        $this->assign('obj', $one);
        $this->display('single');
    }

}